using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;
using System.ComponentModel.DataAnnotations.Schema;
using SalesPages.DomainModel;

namespace SalesPages.EntityFrameworkRepository.Mapping
{
    public class TopRotatorPromotionCity_lnkMap : EntityTypeConfiguration<TopRotatorPromotionCity_lnk>
    {
        public TopRotatorPromotionCity_lnkMap()
        {
            // Primary Key
            this.HasKey(t => t.TopRotatorPromotion_id);

            // Properties
            this.Property(t => t.TopRotatorPromotion_id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.CityName)
                .HasMaxLength(50);

            this.Property(t => t.UpdateBy)
                .HasMaxLength(50);

            this.Property(t => t.CourseType)
                .IsFixedLength()
                .HasMaxLength(1);

            // Table & Column Mappings
            this.ToTable("TopRotatorPromotionCity_lnk");
            this.Property(t => t.TopRotatorPromotion_id).HasColumnName("TopRotatorPromotion_id");
            this.Property(t => t.CityName).HasColumnName("CityName");
            this.Property(t => t.InsertDate).HasColumnName("InsertDate");
            this.Property(t => t.UpdateDate).HasColumnName("UpdateDate");
            this.Property(t => t.UpdateBy).HasColumnName("UpdateBy");
            this.Property(t => t.CourseType).HasColumnName("CourseType");
            this.Property(t => t.TRType).HasColumnName("TRType");
        }
    }
}
